package sudoku;

public class SudokuBlock {
	
	int [][] block = new int[3][3];
	/*
	 *  - x -
	 * |* * *
	 * y* * *
	 * |* * *
	 * 
	 */
	
	public SudokuBlock (int [][] block){
		this.block = block;
	}
	
	public int [] convertBlocktoArray (){
		int [] array = new int [9];
		int counter = 0;
		for(int x = 0; x < block.length; x++){
			for(int y = 0; y < block[x].length; y++){
				array[counter++]=block[x][y];
				
			}
		}
		System.out.println();
		for(int y = 0; y < array.length; y++){
			
					System.out.print(array[y]);
					
		}
		System.out.println();
		return array;
	}
	
	public int [] convertSpecialBlocktoArray (int nr){
		int [] array = new int [9];
		
		System.out.println();
		for(int y = 0; y < array.length; y++){
			
					System.out.print(array[y]);
					
		}
		System.out.println();
		return array;
	}
	
	public boolean validBlock() {
		int [] array = convertBlocktoArray();
		SudokuArray sArray = new SudokuArray(array);
		return sArray.valid(array);
	}

}
